<include file="Public/header" />
<title>管理员列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 盘库 <span class="c-gray en">&gt;</span> 盘库单 <a class="btn btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="pd-20">

	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<form class="formleft" name="" id="" action="__URL__/index/" method="get">
			<span class="select-box" style="width:150px">
				<select class="select" id="selval" name="selval">
					<option value="1">单号</option>
				</select>
			</span>
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['keywords']}>" placeholder="输入查询关键词" name="keywords" datatype="*" nullmsg="请填写搜索词">
			<button type="submit" class="btn btn-success"><i class="icon-plus"></i> 查询</button>
			<a href="javascript:;" onclick="admin_open('添加','__URL__/add_config/',0,'800','480')" class="btn btn-primary radius"><i class="Hui-iconfont"></i> 添加</a>
			<a href="javascript:;"  class="btn btn-success radius" id="pushbar" >推送</a>
			<volist name="warehouse_list" id="vs">
				<label><input type="radio" name="wares" value="<{$vs.warehouse_code}>"><{$vs.name}></label>
			</volist>
		</form>
		<span class="r">共有数据：<strong><{$count}></strong> 条</span> 
    </div>
	
	<table class="table table-border table-bordered table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="15">列表</th>
			</tr>
			<tr class="text-c">
				<th width="25"><input type="checkbox" name="" value=""></th>
				<th>序号</th>
				<th width="">单号</th>
				<th width="">账册编号</th>
				<th width="">申请部门</th>
				<th width="">制单人</th>
				<th width="">申请人</th>
				<th width="">添加时间</th>
				<th width="">操作</th>
			</tr>
		</thead>
		<tbody>
			<volist name="list" id="vo">
			<tr class="text-c">
				<td><input  class="uids" type="checkbox" value="<{$vo.id}>" name="ids[]"></td>
				<td><{$i}></td>
				<td><{$vo.order_no}></td>
				<td><{$vo.manua_id}></td>
				<td><{$vo.section_no}></td>
				<td><{$vo.people_make_no}></td>
				<td><{$vo.people_purchasing_no}></td>
				<td><{$vo.add_time|date="Y-m-d",###}></td>
				<td>
				<a href="javascript:;" onclick="admin_open('编辑','__URL__/edit_config/id/<{$vo.id}>','<{$vo.id}>','800','480')" class="">编辑</a>
				<a href="__URL__/checkstockinfo/">盘库详情</a>
				<a title="删除" href="javascript:;" onclick="admin_del('__URL__/del_config/','<{$vo.id}>')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>
				</td>
			</tr>
			</volist>			
		</tbody>
	</table>
	<div class="page mt" style="text-align:right"><{$page}></div>
</div>
<script type="text/javascript">
    $(function(){
        $("#pushbar").click(function(){
			var option = $(".uids");
			var warehouse_code=$("input[name='wares']:checked").val();
			console.log(warehouse_code);
			if(warehouse_code==null){
				layer.msg('请选择仓库');
				return false;
			}
			var checked_counts=0;
			var check_val=[];
            for(var i=0;i<option.length;i++){
				if(option[i].checked){
					checked_counts++;
					check_val.push(option[i].value);
				}
			}
			if(checked_counts>1){
				layer.msg('一次只能选一个！');
				return false;
			}
			if(check_val==''){
				layer.msg('请选择订单');
				return false;
			}
			$.ajax({
                type: 'POST',
                data:{ids:check_val,warehouse_code:warehouse_code},
                url: "<{:U('checkstockapi')}>",
                success:function(data){
					if(data.status){
						layer.msg('推送成功',function(){
							location.reload();
						});
						
					}else{
						layer.msg(data.message,function(){
							location.reload();
						});
					}
                }
            })
        });
    })
</script>
 <include file="Public/footer" />
<include file="Public/footer_js" />
</body>
</html>